﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace CommonMvc.Models.T
{
    /// <summary>
    /// 在线报名分类
    /// </summary>
    public class EnrollClassify :BasicEntityModel
    {
        public int Id { get; set; }
        /// <summary>
        /// 分类名
        /// </summary>
        /// 
        [Required]
        [MaxLength(20,ErrorMessage ="最长20位")]
        public string ClassifyName { get; set; }
        /// <summary>
        /// 分类对应图片url
        /// </summary>
        ///  
        [Required]
        [MaxLength(20, ErrorMessage = "最长50位")]
        public string ImgUrl { get; set; }
        /// <summary>
        /// 排序
        ///</summary>
        [Required]
        [Range(0,1000,ErrorMessage ="排序有效值1到1000之间")]
        public int SortNo { get; set; }

        public new static void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<EnrollClassify>()
                .Property(p => p.ClassifyName)
                .HasMaxLength(20)
                .IsRequired(true);
            modelBuilder.Entity<EnrollClassify>()
                .Property(p => p.ImgUrl)
                .HasMaxLength(50)
                .IsRequired(true);
            modelBuilder.Entity<EnrollClassify>()
                .Property(p => p.SortNo)
                .IsRequired(true);
        }
    }
    /// <summary>
    /// 在线报名model
    /// </summary>
    public class Enrolls
    {
        private int _id;
        /// <summary>
        /// id
        /// </summary>
        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private int _shopid;
        /// <summary>
        /// shopid
        /// </summary>
        public int ShopId
        {
            get { return _shopid; }
            set { _shopid = value; }
        }

        private string _title;
        /// <summary>
        /// 标题
        /// </summary>
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        private string _desc;
        /// <summary>
        /// 描述
        /// </summary>
        public string Desc
        {
            get { return _desc; }
            set { _desc = value; }
        }

        private string _content;
        /// <summary>
        /// 活动详情
        /// </summary>
        public string Content
        {
            get { return _content; }
            set { _content = value; }
        }

        private int _signtotal;
        /// <summary>
        /// 报名人数
        /// </summary>
        public int SignTotal
        {
            get { return _signtotal; }
            set { _signtotal = value; }
        }

        private DateTime? _signbegintime;
        /// <summary>
        /// 报名开始时间
        /// </summary>
        public DateTime? SignBeginTime
        {
            get { return _signbegintime; }
            set { _signbegintime = value; }
        }

        private DateTime? _signendtime;
        /// <summary>
        /// 报名结束时间
        /// </summary>
        public DateTime? SignEndTime
        {
            get { return _signendtime; }
            set { _signendtime = value; }
        }

        private DateTime _begintime;
        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime BeginTime
        {
            get { return _begintime; }
            set { _begintime = value; }
        }

        private DateTime _endtime;
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime
        {
            get { return _endtime; }
            set { _endtime = value; }
        }

        private int _state;
        /// <summary>
        /// 状态 0未发布，1已发布
        /// </summary>
        public int State
        {
            get { return _state; }
            set { _state = value; }
        }

        private int _isdel;
        /// <summary>
        /// 是否删除
        /// </summary>
        public int IsDel
        {
            get { return _isdel; }
            set { _isdel = value; }
        }

        private string _listimg;
        /// <summary>
        /// 列表图片
        /// </summary>
        public string ListImg
        {
            get { return _listimg; }
            set { _listimg = value; }
        }
        /// <summary>
        /// 参与限制
        /// </summary>
        public int JoinLimit { get; set; }
        /// <summary>
        /// 普通用户收费
        /// </summary>
        public decimal MemberPrice { get; set; }
        /// <summary>
        /// vip 用户收费
        /// </summary>
        public decimal VipPrice { get; set; }
        /// <summary>
        /// 用户输入信息
        /// </summary>
        public string UserMessage { get; set; }
        public string VideoID { get; set; }
        public int ClassId { get; set; }//专家分类
        public string SpecialName { get; set; }//专家名称
    }

}
